{% extends "admin/base_site.html" %}
{% load i18n admin_urls static admin_modify %}

{% block extrahead %}
    {{ block.super }}
    {{ media }}
{% endblock %}

{% block extrastyle %}
    {{ block.super }}
    <link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}">
{% endblock %}

{% block content %}
<div id="content-main">
    <form method="post">
        {% csrf_token %}
        <input type="hidden" name="post" value="yes">
        <input type="hidden" name="_selected_action" value="{{ selected }}">
        
        <div>
            <fieldset class="module aligned">
                <h2>选择执行环境</h2>
                <div class="form-row">
                    <div>
                        <label for="environment">执行环境:</label>
                        <select name="environment" id="environment" required>
                            <option value="">---------</option>
                            {% for env in environments %}
                            <option value="{{ env.id }}">{{ env }}</option>
                            {% endfor %}
                        </select>
                    </div>
                </div>
            </fieldset>
        </div>

        <div class="submit-row">
            <input type="submit" class="default" value="开始执行">
            <a href="{% url 'admin:api_manager_testcase_changelist' %}" class="button cancel-link">取消</a>
        </div>
    </form>
</div>
{% endblock %} 